<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container {
            width: 400px;
            height: 400px;
            border-top: 1px solid red;
            border-left: 1px solid red;
            display: flex;
        }
        .nav {
            height: 100%;
            display: grid;
            grid-template-rows: repeat(3, 1fr);
        }
        .nav .item {
            width: 100px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-bottom: 1px solid red;
            border-right: 1px solid red;
            box-sizing: border-box;
        }
        .nav .item.active {
            background: cornflowerblue;
        }

        .detail {
            width: 300px;
            height: 100%;
            border-bottom: 1px solid red;
            border-right: 1px solid red;
            box-sizing: border-box;
        }
        .detail img {
            display: block;
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 左边栏 -->
        <div class="nav">
            <div class="item active">女靴</div>
            <div class="item">雪地靴</div>
            <div class="item">呢大衣</div>
        </div>
        <!-- 图片 -->
        <div class="detail">
            <img src="https://t7.baidu.com/it/u=1819248061,230866778&fm=193&f=GIF" alt="">
        </div>
    </div>

    <script src="../lib/jquery.min.js"></script>
    <script>

        const data = [
            {
                goodsType: '女靴',
                imgSrc: 'https://t7.baidu.com/it/u=1819248061,230866778&fm=193&f=GIF',
                msg: '123',
            },
            {
                goodsType: '雪地靴',
                imgSrc: 'https://t7.baidu.com/it/u=4036010509,3445021118&fm=193&f=GIF',
                msg: '456',
            },
            {
                goodsType: '呢大衣',
                imgSrc: 'https://t7.baidu.com/it/u=963301259,1982396977&fm=193&f=GIF',
                msg: '789',
            },
        ];

        $('.nav .item').on('mouseenter', function () {
            // 变.nav .item的颜色
            $(this).addClass('active');
            $(this).siblings().removeClass('active');
            // 换图片
            // 先找索引
            const i = $(this).index();
            $('.detail img').attr({ src: data[i].imgSrc });
        });


    </script>
</body>
</html>